#ifndef _SIMPLEC_H_
#define _SIMPLEC_H_

#include "Equations/PressureCorrection.hpp"

namespace Tuna {

  template <typename T, int Dim> class Simplec;
  
  template <typename T>
  struct Typeinfo <Simplec<T, 1> > {
    typedef T prec_t;
    enum { Dim = 1 };
  };
  
  template <typename T>
  struct Typeinfo <Simplec<T, 2> > {
    typedef T prec_t;
    enum { Dim = 2 };
  };
  
  template <typename T>
  struct Typeinfo <Simplec<T, 3> > {
    typedef T prec_t;
    enum { Dim = 3 };
  };

template<class Tprec, int Dim>
class Simplec : public PressureCorrection<Simplec< Tprec, Dim > >
{
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::aE;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::aW;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::aN;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::aS;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::aF;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::aB;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::aP;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::sp;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::dx;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::dy;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::dz;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::bi;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::ei;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::bj;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::ej;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::bk;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::ek;
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::dt;    
  using GeneralEquation<PressureCorrection<Simplec<Tprec, Dim > > >::phi;

  using PressureCorrection<Simplec<Tprec, Dim> >::u;
  using PressureCorrection<Simplec<Tprec, Dim> >::v;
  using PressureCorrection<Simplec<Tprec, Dim> >::w;
  using PressureCorrection<Simplec<Tprec, Dim> >::p;
  using PressureCorrection<Simplec<Tprec, Dim> >::du;
  using PressureCorrection<Simplec<Tprec, Dim> >::dv;
  using PressureCorrection<Simplec<Tprec, Dim> >::dw;

public:

  typedef Tprec prec_t;
  typedef typename TunaArray<prec_t, Dim >::huge ScalarField;
  typedef typename TunaArray<int, Dim >::tiny intTinyArray_t; 

  Simplec() : PressureCorrection<Simplec<prec_t, Dim> >() { };
  ~Simplec() { }; 


  /*!
   * FVM coefficients calculations in 2D.
   */
  inline bool calcCoefficients2D();

  /*!
   * FVM coefficients calculations in 3D.
   */
  inline bool calcCoefficients3D();

  inline bool correction();
  inline void printInfo() { std::cout << " Simplec "; }
};

} // Tuna namespace

#include "../../src/Schemes/Simplec.cpp"

#endif //_SIMPLEC_H_
